﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace EWMSWeb.CumMain
{
    public partial class LoadImgList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string cusID = hidCumid.Value;
            bindRept(cusID);
        }


        protected void bindRept(string cusID)
        {
            DataTable dt = new DataTable();
            DataLib.BLL.cUser bll = new DataLib.BLL.cUser();
            dt = bll.GetCList(" l.customerid in (" + cusID + ")");
            dt.Columns.Add("Finish");
            if (dt != null && dt.Rows.Count > 0)
            {
                string strTemp = "<a href='javascript:void(0);'{0}>{1}</a>";
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["loadState"].ToString() != "5")
                    {
                        dr["Finish"] = string.Format(strTemp, " onclick='finishLoad(" + dr["loadid"] + ")'", "完成");
                    }
                    else
                    {
                        dr["Finish"] = string.Format(strTemp, "", "已完成");
                    }
                }
            }
            rept.DataSource = dt;
            rept.DataBind();
        }
    }
}